package cn.uai.activiti8.util;

import cn.uai.activiti8.constant.TimePatternConstant;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @desc 时间格式化工具
 * @author uai
 * @since 2025/7/28 16:29
 * @version 1.0
 */
public class TimeFormatter {

    public static LocalDateTime formatWithParse(String time) {
        return LocalDateTime.parse(time, DateTimeFormatter.ofPattern(TimePatternConstant.DEFAULT));
    }

    public static String format(LocalDateTime time) {
        return time.format(DateTimeFormatter.ofPattern(TimePatternConstant.DEFAULT));
    }
}
